Names of the Collaborators¶

  • TRINAY GANGISETTY
  • EVAN McCORMICK
  • JULIA GALLWITZ
  • AISHWARYA PURANIK
  • SAWANI HEJIB

Statement of the question of the interest¶

  • In economics, an exogenous shock is a significant and unpredictable event that greatly impacts a local or global economy. An exogenous shock can be an event such as an earthquake, a flood, or the COVID-19 pandemic. When an exogenous shock occurs, governments must implement targeted policy measures to ensure the stability of the economy and the security of their citizens.

  • From travel and communication, to trade and supply chain expansion, our world has never been more connected than it is now and the COVID-19 pandemic was a first-of-its-kind event in modern times. In early 2020, governments all across the globe were required to react quickly to this unprecedented exogenous shock, as it significantly disrupted the established financial processes and threatened the stability of the global economy. The following analysis will investigate the various financial sector policy measures implemented at the country level and globally in the initial months of the COVID-19 pandemic.

Data source and Description¶

  • The data set is primarily sourced from public information collected by the World Bank and various COVID-19 financial response trackers maintained by entities such as the Yale Program on Financial Stability, IDB, IIF, IMF, and OECD.
  • This comprehensive dataset meticulously documents the diverse array of policy measures enacted by governments globally in response to the challenges posed by the COVID-19 pandemic on the financial sector.
  • The dataset classifies these policies into five primary domains:
    • Banking sector
    • Financial markets and institutions
    • Insolvency
    • Liquidity/funding and
    • Payments systems.
  • Within each of these overarching categories, a detailed breakdown into sub-categories offers a nuanced view of the specific strategies employed.

    1. In the banking sector, policies encompass crisis management, integrity, operational continuity, prudential measures, and support for borrowers.
    2. In financial markets and institutions, sub-categories include market functioning, non-bank financial institutions (NBFI), and public debt management.
    3. The insolvency category comprises measures related to amending bankruptcy filing obligations, enhancing tools for out-of-court debt restructuring and workouts, and other insolvency-related actions. Liquidity and funding measures extend to asset purchases, liquidity (including foreign exchange), policy rate adjustments, and other liquidity-related interventions.
    4. Lastly, the payments systems sector includes sub-categories like consumer protection, easing regulatory requirements, promoting and ensuring the availability of digital payment mechanisms, and other payment-related policies.
  • These meticulously organized sub-categories provide invaluable insights into the multifaceted policy responses implemented worldwide during the pandemic.

  • Moreover, these sub-categories are further refined into granular classifications, adding depth to the dataset's granularity.
  • Notable data points encompass the precise date of policy announcement, the responsible authority tasked with implementation, references to the public sources of these announcements, the termination dates of individual policies, and identification of measures that represent modifications or extensions of existing ones.
In [1]:
# importing libraries

import numpy as np
import pandas as pd
In [2]:
# Encoding the file

covid_data = pd.read_csv("covid-fci-data.csv", encoding = 'Latin1')
In [3]:
#Converting the column names to upper case

covid_data.columns = covid_data.columns.str.upper()
In [4]:
#examining the data set

covid_data.head()
Out[4]:
ID COUNTRY NAME COUNTRY ISO3 INCOME LEVEL AUTHORITY DATE LEVEL 1 POLICY MEASURES LEVEL 2 POLICY MEASURES LEVEL 3 POLICY MEASURES DETAILS OF THE MEASURE REFERENCE TERMINATION DATE MODIFICATION OF PARENT MEASURE PARENT MEASURE
0 1 China CHN Upper middle income SUP 01-02-2020 Banking sector Operational continuity ... Blank ... Require banks and insurance companies to ensur... http://www.gov.cn/zhengce/zhengceku/2020-02/03... NaN No NaN
1 2 Canada CAN High income CB 13-03-2020 Liquidity/funding Liquidity (incl FX)/ELA ... Blank ... BoC also created a Bankers Acceptance Purchase... https://www.bankofcanada.ca/markets/market-ope... 31-10-2020 No NaN
2 3 China CHN Upper middle income CB 05-02-2020 Banking sector Integrity ... Other integrity ... The PBC has issued Notices on AML/CFT requirem... ... NaN No NaN
3 4 Thailand THA Upper middle income CB 05-02-2020 Liquidity/funding Policy rate ... Blank ... BOT cut its benchmark interest rate by 25 basi... https://www.bot.or.th/English/PressandSpeeches... NaN No NaN
4 5 Russian Federation RUS Upper middle income CB 07-02-2020 Liquidity/funding Policy rate ... Blank ... Policy rates were reduced by 25 basis points t... https://www.cnbc.com/2020/02/07/reuters-americ... NaN No NaN
In [5]:
# re-naming the columns

covid_data.rename(columns = {'COUNTRY NAME': 'COUNTRY_NAME',
                             'COUNTRY ISO3': 'COUNTRY_CODE',
                             'INCOME LEVEL': 'INCOME_LEVEL',
                             'LEVEL 1 POLICY MEASURES': 'LEVEL_1_POLICY_MEASURES',
                             'LEVEL 2 POLICY MEASURES': 'LEVEL_2_POLICY_MEASURES',
                             'LEVEL 3 POLICY MEASURES': 'LEVEL_3_POLICY_MEASURES',
                             'DETAILS OF THE MEASURE': 'DETAILS_OF_THE_MEASURE',
                             'TERMINATION DATE': 'TERMINATION_DATE',
                             'MODIFICATION OF PARENT MEASURE': 'MODIFICATION_OF_PARENT_MEASURE',
                             'PARENT MEASURE': 'PARENT_MEASURE'}, inplace = True)
In [6]:
# examining again after re-naming the columns

covid_data.head()
Out[6]:
ID COUNTRY_NAME COUNTRY_CODE INCOME_LEVEL AUTHORITY DATE LEVEL_1_POLICY_MEASURES LEVEL_2_POLICY_MEASURES LEVEL_3_POLICY_MEASURES DETAILS_OF_THE_MEASURE REFERENCE TERMINATION_DATE MODIFICATION_OF_PARENT_MEASURE PARENT_MEASURE
0 1 China CHN Upper middle income SUP 01-02-2020 Banking sector Operational continuity ... Blank ... Require banks and insurance companies to ensur... http://www.gov.cn/zhengce/zhengceku/2020-02/03... NaN No NaN
1 2 Canada CAN High income CB 13-03-2020 Liquidity/funding Liquidity (incl FX)/ELA ... Blank ... BoC also created a Bankers Acceptance Purchase... https://www.bankofcanada.ca/markets/market-ope... 31-10-2020 No NaN
2 3 China CHN Upper middle income CB 05-02-2020 Banking sector Integrity ... Other integrity ... The PBC has issued Notices on AML/CFT requirem... ... NaN No NaN
3 4 Thailand THA Upper middle income CB 05-02-2020 Liquidity/funding Policy rate ... Blank ... BOT cut its benchmark interest rate by 25 basi... https://www.bot.or.th/English/PressandSpeeches... NaN No NaN
4 5 Russian Federation RUS Upper middle income CB 07-02-2020 Liquidity/funding Policy rate ... Blank ... Policy rates were reduced by 25 basis points t... https://www.cnbc.com/2020/02/07/reuters-americ... NaN No NaN
In [7]:
# removing the white space on both the trailing ends

covid_data['LEVEL_1_POLICY_MEASURES'] = covid_data['LEVEL_1_POLICY_MEASURES'].str.strip()
In [8]:
# removing the white space on both the trailing ends

covid_data['LEVEL_2_POLICY_MEASURES'] = covid_data['LEVEL_2_POLICY_MEASURES'].str.strip()
In [9]:
# removing the white space on the trailing ends

covid_data['INCOME_LEVEL'] = covid_data['INCOME_LEVEL'].str.strip()
In [10]:
# Finding out the percentage that each level_2_measure contributes with in the level_1_measure

grouping_measures = covid_data.groupby(['LEVEL_1_POLICY_MEASURES','LEVEL_2_POLICY_MEASURES'])['ID'].sum().rename("Percentage").groupby(level = 0).transform(lambda x: 100 * x/x.sum())
grouping_measures = grouping_measures.reset_index()
grouping_measures['Percentage'] = np.round(grouping_measures['Percentage'], 2) # rounding the percentage
grouping_measures
Out[10]:
LEVEL_1_POLICY_MEASURES LEVEL_2_POLICY_MEASURES Percentage
0 Banking sector Crisis management 0.73
1 Banking sector Integrity 2.72
2 Banking sector Operational continuity 1.29
3 Banking sector Prudential 52.98
4 Banking sector Support borrowers 42.27
5 Financial Markets/NBFI Market functioning 71.33
6 Financial Markets/NBFI NBFI 21.79
7 Financial Markets/NBFI Public debt management 6.88
8 Insolvency Amending bankruptcy filing obligations 86.89
9 Insolvency Enhancing tools for out-of-court debt restruct... 10.83
10 Insolvency Other insolvency 2.28
11 Liquidity/funding Asset purchases 9.23
12 Liquidity/funding Liquidity (incl FX)/ELA 66.84
13 Liquidity/funding Other liquidity 0.51
14 Liquidity/funding Policy rate 23.42
15 Payment systems Consumer protection measures and ensuring avai... 7.72
16 Payment systems Easing regulatory requirements 10.32
17 Payment systems Other Payments 11.98
18 Payment systems Promoting and ensuring availability of digital... 69.98
In [11]:
grouping_measures['LEVEL_1_POLICY_MEASURES'] = grouping_measures['LEVEL_1_POLICY_MEASURES'].str.strip()
In [12]:
# looking at the value counts of the level_1_policy_measures column

grouping_measures['LEVEL_1_POLICY_MEASURES'].value_counts()
Out[12]:
Banking sector            5
Liquidity/funding         4
Payment systems           4
Financial Markets/NBFI    3
Insolvency                3
Name: LEVEL_1_POLICY_MEASURES, dtype: int64
In [13]:
# seperating each of the policy measure into its own variable

banking = grouping_measures[grouping_measures['LEVEL_1_POLICY_MEASURES'] == 'Banking sector']
financial = grouping_measures[grouping_measures['LEVEL_1_POLICY_MEASURES'] == 'Financial Markets/NBFI']
liquidity = grouping_measures[grouping_measures['LEVEL_1_POLICY_MEASURES'] == 'Liquidity/funding']
payments = grouping_measures[grouping_measures['LEVEL_1_POLICY_MEASURES'] == 'Payment systems']
insolvency = grouping_measures[grouping_measures['LEVEL_1_POLICY_MEASURES'] == 'Insolvency']
In [14]:
# setting index for each of the measure for the ease of visualization plotting

banking = banking.set_index(banking['LEVEL_2_POLICY_MEASURES'])
financial = financial.set_index(financial['LEVEL_2_POLICY_MEASURES'])
liquidity = liquidity.set_index(liquidity['LEVEL_2_POLICY_MEASURES'])
payments = payments.set_index(payments['LEVEL_2_POLICY_MEASURES'])
insolvency = insolvency.set_index(insolvency['LEVEL_2_POLICY_MEASURES'])
In [15]:
banking
Out[15]:
LEVEL_1_POLICY_MEASURES LEVEL_2_POLICY_MEASURES Percentage
LEVEL_2_POLICY_MEASURES
Crisis management Banking sector Crisis management 0.73
Integrity Banking sector Integrity 2.72
Operational continuity Banking sector Operational continuity 1.29
Prudential Banking sector Prudential 52.98
Support borrowers Banking sector Support borrowers 42.27
In [16]:
# pip install pywaffle (to create waffle charts coz pycharts are too boring..)
In [17]:
from pywaffle import Waffle
import matplotlib.pyplot as plt
import pandas as pd

# Waffle subfigure
fig = plt.figure(
    FigureClass = Waffle,
    plots = {
        # 5 figures with the axis 511, 512, 513 ...
        511: {
            'values': banking['Percentage'], 
            'labels': [f"{k} ({v} %)" for k, v in banking['Percentage'].items()], # unzipping for the labels in the legend
            'legend': {'loc': 'upper left', 'bbox_to_anchor': (1.05, 1), 'fontsize': 8},
            'title': {'label': 'Banking sector', 'loc': 'left', 'fontsize': 10},
            'colors': ["#d55e00", "#cc79a7", "#0072b2", "#f0e442", "#009e73"] # using color blind friendly colours
        }, 
        512: {
            'values': financial['Percentage'],
            'labels': [f"{k} ({v} %)" for k, v in financial['Percentage'].items()],
            'legend': {'loc': 'upper left', 'bbox_to_anchor': (1.05, 1), 'fontsize': 8},
            'title': {'label': 'Financial Markets/NBFI', 'loc': 'left', 'fontsize': 10},
            'colors': ["#232066", "#983D3D", "#DCB732"]
        },
        513: {
            'values': insolvency['Percentage'],
            'labels': [f"{k} ({v} %)" for k, v in insolvency['Percentage'].items()],
            'legend': {'loc': 'upper left', 'bbox_to_anchor': (1.05, 1), 'fontsize': 8},
            'title': {'label': 'Insolvency', 'loc': 'left', 'fontsize': 10},
            'colors': ["#FEFE62", "#DC3220", "#E1BE6A"]
        },
        514: {
            'values': liquidity['Percentage'],
            'labels': [f"{k} ({v} %)" for k, v in liquidity['Percentage'].items()],
            'legend': {'loc': 'upper left', 'bbox_to_anchor': (1.05, 1), 'fontsize': 8},
            'title': {'label': 'Liquidity/funding', 'loc': 'left', 'fontsize': 10},
            'cmap_name': "Dark2"
        },
        515: {
            'values': payments['Percentage'],
            'labels': [f"{k} ({v} %)" for k, v in payments['Percentage'].items()],
            'legend': {'loc': 'upper left', 'bbox_to_anchor': (1.05, 1), 'fontsize': 8},
            'title': {'label': 'Payment systems', 'loc': 'left', 'fontsize': 10},
            'cmap_name': "Paired"
        }
    },
    rows = 10,
    figsize = (10,10),
    cmap_name = "tab20b")

fig.suptitle('Breakdown of Policy measures by the Target area', fontsize = 12, fontweight = 'bold')

# plt.show()
Out[17]:
Text(0.5, 0.98, 'Breakdown of Policy measures by the Target area')

Interpretation¶

  • The following Breakdown of Policy measures by the Target area shows the percentage of specific policy measures for all the Level - 1 policies.
  • Each small square represents 1 precent and there are 100 squares in each waffle graph which totals to 100%

Insights / Trends¶

From the graph we can observe that

  1. When the target area is Banking Sector, the main policy actions taken were Prudential which accounts to 52.98%
    • The word Prudential means careful and avoiding risks
    • Prudential actions are intended to maintain the stability and safety of financial institutions
    • For example, in March 2020 Guyana reduced or waived fees and transactions for ATM services, loan processing, and so on as a prudential policy measure
  2. When the target area is Liquidity / Funding, the main policy actions taken were Liquidity which accounts to 66.84%
    • Liquidity is selling off immovable securities to convert to liquid cash.
    • For example, in Msarch 2020 USA announced 1.5 trillion dollors in repo operations, which refers to the selling and repurchasing of government securities.
  3. When the target area is Financial Markets / NBFI, the main policy actions taken were Market Functioning which accounts to 71.33%
    • The most important measure that could be taken to prevent the crash in the economy is to keep the market active and functioning.
    • NBFI (Non Banking Financial Institutions) which are private organisations play a major role in providing loans to the small businesses to keep them functioning
  4. When the target area is Payment Systems, the main policy actions taken were digital payment mechanisms which accounts to 69.98%
    • There was a huge spike observed in online and digitized transactions during the pandemic all over the countries due to the restrictions imposed
    • To encourage the use of internet and promote the digitization of the country, many countries have taken several measures to revolutionize the world in the way of modernization and there by waiving of the taxes and fees for the transactions made digitally.
  5. When the target area is Insolvency, the main policy actions taken were Amending Bankruptcy which accounts to 86.89%

Choice of Visualization¶

This would be the most convinient method to visualize the graph. because we can easily identify the measure with he highest percentage looking the waffle graph and the visual comparision would be very easy which inturn makes it very easy for the non - technical people to understand the graph better with out any efforts

In [18]:
# converting from string to date type

covid_data['DATE'] = pd.to_datetime(covid_data['DATE'])
C:\Users\HP\AppData\Local\Temp\ipykernel_20772\3618321463.py:3: UserWarning: Parsing dates in DD/MM/YYYY format when dayfirst=False (the default) was specified. This may lead to inconsistently parsed dates! Specify a format to ensure consistent parsing.
  covid_data['DATE'] = pd.to_datetime(covid_data['DATE'])
In [19]:
covid_data['DATE'].dtype
Out[19]:
dtype('<M8[ns]')
In [20]:
# counting number_of_measures taken by each country globally

number_of_measures_taken = covid_data.groupby(['COUNTRY_NAME'])['ID'].count()
number_of_measures_taken = number_of_measures_taken.reset_index()
number_of_measures_taken.sort_values(by = 'ID')
Out[20]:
COUNTRY_NAME ID
93 Micronesia, Fed. Sts. 1
83 Libya 1
65 Iran, Islamic Rep. 2
37 Djibouti 2
66 Iraq 2
... ... ...
133 Sri Lanka 103
74 Korea, Rep. 105
132 Spain 110
68 Italy 123
63 India 134

157 rows × 2 columns

In [21]:
# re-naming the column for better understanding

# pip install pycountry
number_of_measures_taken.rename(columns = {'ID':'TOTAL_MEASURES_COUNT'}, inplace = True)
In [22]:
number_of_measures_taken['COUNTRY_NAME'] = number_of_measures_taken['COUNTRY_NAME'].str.strip()
In [23]:
number_of_measures_taken.columns
Out[23]:
Index(['COUNTRY_NAME', 'TOTAL_MEASURES_COUNT'], dtype='object')
In [24]:
# running a loop through the country names and attaching their respective country codes for the purpose of map visualization
# using 'plotly' library with choropleth.

import pycountry 
def alpha3code(column):
    CODE=[]
    for country in column:
        try:
            code=pycountry.countries.get(name=country).alpha_3
           # .alpha_3 means 3-letter country code 
           # .alpha_2 means 2-letter country code
            CODE.append(code)
        except:
            CODE.append('None')
    return CODE
# create a column for code 
number_of_measures_taken['CODE']=alpha3code(number_of_measures_taken.COUNTRY_NAME)
number_of_measures_taken.head()
Out[24]:
COUNTRY_NAME TOTAL_MEASURES_COUNT CODE
0 Afghanistan 8 AFG
1 Albania 17 ALB
2 Algeria 9 DZA
3 Angola 5 AGO
4 Anguilla 4 AIA
In [25]:
# code for plotting a map visualization

import io

import plotly.express as px

np.random.seed(12)
gapminder = number_of_measures_taken
# gapminder['counts'] = np.random.uniform(low=100000, high=200000, size=len(gapminder)).tolist()

fig = px.choropleth(gapminder, locations="CODE",
                    locationmode='ISO-3',
                    color = "TOTAL_MEASURES_COUNT", 
                    hover_name="CODE",
                    color_continuous_scale=px.colors.sequential.Reds)
fig.update_layout(title = {
    'text': "Number of Policy Measures Initiated by each country",
    'xanchor': "center",
    'yanchor': "top",
    'x': 0.44,
    'y': 0.99,
    'font_size': 20
})

fig.show()

Interpretation¶

  • The following World map shows the Number/count of Policy Measures Initiated by each country globally.
  • The darker the color, the higher the number of measures is

Insights / Trends¶

  • From the graph we can observe that
    • India has the highest number of measures taken and the count stands at 134
    • Libya and Micronesia has the lowest measures taken and the count stands at 1 for both
  • These interpretations can be determined easily with the help of colour density.
  • This gives insights about the severity of the disease as well as responsibility of the government.

Choice of Visualization¶

This would be the most convenient method to visualize the graph. because we can easily identify the state looking the map and the visual comparison would be very easy which inturn makes it very easy for the non - technical people to understand the graph better with out any efforts

In [26]:
# India has highest measures taken.

gapminder.sort_values(by='TOTAL_MEASURES_COUNT', ascending=False)
Out[26]:
COUNTRY_NAME TOTAL_MEASURES_COUNT CODE
63 India 134 IND
68 Italy 123 ITA
132 Spain 110 ESP
74 Korea, Rep. 105 None
133 Sri Lanka 103 LKA
... ... ... ...
119 Samoa 2 WSM
129 Solomon Islands 2 SLB
51 Gambia, The 2 None
83 Libya 1 LBY
93 Micronesia, Fed. Sts. 1 None

157 rows × 3 columns

In [27]:
# Inspecting when is the first date that a particular country started taking measure and when did they stop and when was the 
# last measure taken

country_frame = covid_data.groupby(['COUNTRY_NAME'])
country_frame = country_frame.agg(Minimum_Date=('DATE', np.min), Maximum_Date=('DATE', np.max))
country_frame
Out[27]:
Minimum_Date Maximum_Date
COUNTRY_NAME
Afghanistan 2020-05-27 2020-09-04
Albania 2020-01-04 2020-12-03
Algeria 2020-03-15 2020-06-04
Angola 2020-03-04 2020-10-05
Anguilla 2020-03-04 2020-03-27
... ... ...
Uzbekistan 2020-03-04 2021-11-03
Vietnam 2020-03-17 2020-12-05
West Bank and Gaza 2020-03-27 2020-09-03
Zambia 2020-01-04 2020-05-20
Zimbabwe 2020-01-05 2021-01-02

157 rows × 2 columns

In [28]:
covid_data.head(2)
Out[28]:
ID COUNTRY_NAME COUNTRY_CODE INCOME_LEVEL AUTHORITY DATE LEVEL_1_POLICY_MEASURES LEVEL_2_POLICY_MEASURES LEVEL_3_POLICY_MEASURES DETAILS_OF_THE_MEASURE REFERENCE TERMINATION_DATE MODIFICATION_OF_PARENT_MEASURE PARENT_MEASURE
0 1 China CHN Upper middle income SUP 2020-01-02 Banking sector Operational continuity Blank ... Require banks and insurance companies to ensur... http://www.gov.cn/zhengce/zhengceku/2020-02/03... NaN No NaN
1 2 Canada CAN High income CB 2020-03-13 Liquidity/funding Liquidity (incl FX)/ELA Blank ... BoC also created a Bankers Acceptance Purchase... https://www.bankofcanada.ca/markets/market-ope... 31-10-2020 No NaN
In [29]:
# grouping the countries with respect to income class level

classes = covid_data.groupby(['COUNTRY_NAME','INCOME_LEVEL','LEVEL_1_POLICY_MEASURES','AUTHORITY'])['ID'].count()
classes = classes.reset_index()
classes
Out[29]:
COUNTRY_NAME INCOME_LEVEL LEVEL_1_POLICY_MEASURES AUTHORITY ID
0 Afghanistan Low income Banking sector CB 5
1 Afghanistan Low income Liquidity/funding CB 1
2 Afghanistan Low income Payment systems CB 2
3 Albania Upper middle income Banking sector CB 9
4 Albania Upper middle income Banking sector GOV 1
... ... ... ... ... ...
850 Zimbabwe Lower middle income Banking sector GOV 8
851 Zimbabwe Lower middle income Financial Markets/NBFI GOV 1
852 Zimbabwe Lower middle income Financial Markets/NBFI SUP 1
853 Zimbabwe Lower middle income Liquidity/funding CB 12
854 Zimbabwe Lower middle income Payment systems MoF 1

855 rows × 5 columns

In [30]:
# There are two same values with difference in the capitalization

classes['INCOME_LEVEL'].value_counts()
Out[30]:
Upper middle income    284
High income            276
Lower middle income    200
Low income              87
Upper Middle Income      4
Aggregates               4
Name: INCOME_LEVEL, dtype: int64
In [31]:
# renaming the value so that duplicate categories can be avoided

classes['INCOME_LEVEL'] = classes['INCOME_LEVEL'].str.replace('Upper Middle Income','Upper middle income')
In [32]:
# inspecting after renaming

classes['INCOME_LEVEL'].value_counts()
Out[32]:
Upper middle income    288
High income            276
Lower middle income    200
Low income              87
Aggregates               4
Name: INCOME_LEVEL, dtype: int64
In [33]:
# removing the authority as it has less significance

income_levels = classes.groupby(['INCOME_LEVEL','LEVEL_1_POLICY_MEASURES'])['ID'].count().rename("PERCENTAGE").groupby(level = 0).transform(lambda x: 100 * x/x.sum())
income_levels = income_levels.reset_index()
income_levels
Out[33]:
INCOME_LEVEL LEVEL_1_POLICY_MEASURES PERCENTAGE
0 Aggregates Banking sector 50.000000
1 Aggregates Financial Markets/NBFI 25.000000
2 Aggregates Insolvency 25.000000
3 High income Banking sector 48.188406
4 High income Financial Markets/NBFI 21.376812
5 High income Insolvency 6.521739
6 High income Liquidity/funding 14.492754
7 High income Payment systems 9.420290
8 Low income Banking sector 34.482759
9 Low income Financial Markets/NBFI 13.793103
10 Low income Liquidity/funding 28.735632
11 Low income Payment systems 22.988506
12 Lower middle income Banking sector 42.500000
13 Lower middle income Financial Markets/NBFI 14.500000
14 Lower middle income Insolvency 4.000000
15 Lower middle income Liquidity/funding 22.000000
16 Lower middle income Payment systems 17.000000
17 Upper middle income Banking sector 44.097222
18 Upper middle income Financial Markets/NBFI 20.486111
19 Upper middle income Insolvency 4.861111
20 Upper middle income Liquidity/funding 19.444444
21 Upper middle income Payment systems 11.111111
In [34]:
# pip install plotly
import warnings
# to disable if there are any warnings
warnings.filterwarnings("ignore")
In [35]:
# plotting a spyder/radar chart for different levels of income classes to look into what measures were taken the most in their 
# respective classes.

import plotly.express as px
import time
t1 = time.time()

fig = px.line_polar(income_levels, r='PERCENTAGE', theta='LEVEL_1_POLICY_MEASURES', color='INCOME_LEVEL', line_close=True, template="plotly_dark")
fig.update_traces(fill="toself")
fig.update_layout(title = {
    'text': "Target Area Breakdown by Income Level",
    'xanchor': "center",
    'yanchor': "top",
    'x': 0.44,
    'y': 0.99,
    'font_size': 20
})
fig.show()

t2 = time.time()
print(t2-t1) # total processing time

# changed the theme colour for good vision purposes.
0.20844483375549316

Interpretation¶

  • The following spyder chart or radial chart shows the Target area breakdown by Income Level for all the countries in the world.
  • The radius circular counts represents the percentage that each Income Level contributes to the target area.

Insights / Trends¶

  • From the chart we can observe that
    • Only Low Income Countries are prefering Liquidity because it is obvious that low income countries in general do not have any cash available instantaneously.
    • Banking Sector measures were taken the most among all categories of countries.
    • Measures related to Insolvency were not taken by any category of the countries which is interesting.
  • These interpretations can be determined easily with the help of curves intersecting each and every categorical lines.

Choice of Visualization¶

This would be the most convinient method to visualize the graph because we can easily identify the percentage of the measures for countries with different income categories looking at the graph and the visual comparision would be very easy which inturn makes it very easy for the non - technical people to understand the graph better with out any efforts

In [36]:
# Quantitative Analysis......
In [37]:
# Created a new table from the existing data set using 'R' language and wriiten that to a new csv file in order to
# get Quantitative data since the previous data set has only Qualitative columns.
In [38]:
# reading the newly created file with absolute path
# This file is created such that the count of measures taken by each country in a particular month in the year 2020.

covid_pol_cat = pd.read_csv(r"C:\Users\HP\Downloads\GroupProject_VisualizingCOVIDEconomicData2\GroupProject_VisualizingCOVIDEconomicData\data\covid-pol-count-country-month.csv")
covid_pol_cat
Out[38]:
Country Name Month Banking sector Liquidity/funding Payment systems Financial Markets/NBFI Insolvency
0 Afghanistan 4 5 1 0 0 0
1 Afghanistan 5 0 0 2 0 0
2 Albania 3 3 2 0 0 0
3 Albania 4 1 0 2 1 0
4 Albania 5 5 0 0 0 1
... ... ... ... ... ... ... ...
730 Zimbabwe 3 2 4 0 1 0
731 Zimbabwe 4 1 2 0 0 0
732 Zimbabwe 5 7 2 0 0 0
733 Zimbabwe 6 0 2 1 1 0
734 Zimbabwe 7 0 1 0 0 0

735 rows × 7 columns

In [39]:
# getting count for the famous countries

covid_uk_pol_cat = covid_pol_cat[covid_pol_cat["Country Name"]=="United Kingdom"]
covid_us_pol_cat = covid_pol_cat[covid_pol_cat["Country Name"]=="United States"]
covid_bra_pol_cat = covid_pol_cat[covid_pol_cat["Country Name"]=="Brazil"]
covid_ind_pol_cat = covid_pol_cat[covid_pol_cat["Country Name"]=="India"]
covid_jap_pol_cat = covid_pol_cat[covid_pol_cat["Country Name"]=="Japan"]
In [40]:
covid_uk_pol_cat
Out[40]:
Country Name Month Banking sector Liquidity/funding Payment systems Financial Markets/NBFI Insolvency
690 United Kingdom 3 10 6 0 1 3
691 United Kingdom 4 10 4 1 0 1
692 United Kingdom 5 9 1 1 1 0
693 United Kingdom 6 1 1 2 1 1
694 United Kingdom 7 5 0 0 0 0
695 United Kingdom 8 1 1 1 0 0
696 United Kingdom 9 4 0 0 1 0
697 United Kingdom 10 2 0 0 1 0
698 United Kingdom 11 2 0 0 0 0
699 United Kingdom 12 2 0 0 0 0
In [41]:
# Profile of Economic policy types in the USA from March-December 2020

plt.stackplot(covid_us_pol_cat["Month"],
             covid_us_pol_cat["Banking sector"],
             covid_us_pol_cat["Liquidity/funding"],
             covid_us_pol_cat["Payment systems"],
             covid_us_pol_cat["Financial Markets/NBFI"],
             covid_us_pol_cat["Insolvency"],
             labels=list(covid_us_pol_cat.columns)[2:])
plt.legend()
plt.xticks(covid_us_pol_cat["Month"],["Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"])
plt.title("Profile of Economic policy types in the USA from March-December 2020")
Out[41]:
Text(0.5, 1.0, 'Profile of Economic policy types in the USA from March-December 2020')
In [42]:
# Profile of Economic policy types in India from February-December 2020

plt.stackplot(covid_ind_pol_cat["Month"],
             covid_ind_pol_cat["Banking sector"],
             covid_ind_pol_cat["Liquidity/funding"],
             covid_ind_pol_cat["Payment systems"],
             covid_ind_pol_cat["Financial Markets/NBFI"],
             covid_ind_pol_cat["Insolvency"],
             labels=list(covid_ind_pol_cat.columns)[2:])
plt.legend()
plt.xticks(covid_ind_pol_cat["Month"],["Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"])
plt.title("Profile of Economic policy types in India from February-December 2020")
Out[42]:
Text(0.5, 1.0, 'Profile of Economic policy types in India from February-December 2020')

Interpretation¶

  • The following two area graphs illustrates the aggregate of policy measures taken in the initial months in US and India respectively.
  • Each color represents one category out of all five targeted areas.

Insights / Trends¶

From the graph we can observe that

  • India had more policy measures related to financial markets and nonbank financial institutions than the US during the year 2020.
  • By far the largest target area was the banking sector for both the countries but the second largest in USA is liquidity/funding, however in India it was financial markets or non-banking financial institutes.
  • In India first drop off in policy count accrued in May whereas in the USA the first drop-off occurred in April.
  • Drop-off in policy counts occur was sharper in India in May whereas in you the policy count was tapered down throughout the summer (i.e. Apr, May, Jun, July)
  • These interpretations can be determined easily with the help of different colors assigned to each targeted area.
  • This gives insights about how each government reacted differently to the global COVID-19 pandemic.

Choice of Visualization¶

This chart would be the most convenient method to analyze how the policy counts under different targeted areas changes over time using different colors. This way we can also compare the policy count change among the countries just to see how different government responded to COVID-19 in terms of economic measures.

In [43]:
# Monthy Global Economic Policy by Category in the year 2020

covid_international_pol = covid_pol_cat.groupby(["Month"]).sum()
plt.stackplot(list(np.arange(12)),
             covid_international_pol["Banking sector"],
             covid_international_pol["Liquidity/funding"],
             covid_international_pol["Payment systems"],
             covid_international_pol["Financial Markets/NBFI"],
             covid_international_pol["Insolvency"],
             labels=list(covid_international_pol.columns))
plt.legend()
plt.xticks(list(np.arange(12)),["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"])
plt.title("Monthy Global Economic Policy by Category in the year 2020")
Out[43]:
Text(0.5, 1.0, 'Monthy Global Economic Policy by Category in the year 2020')

Interpretation¶

  • The preceding stacked area charts represent the number of policy changes enacted by month for the given countries, and the world as a whole.
  • The y axis measures the number of policy changes which occurred each month, color-coded by their category. The months are listed along the x-axis.

Insights / Trends¶

  • From the chart we can observe that
    • There was a distinct spike in economic policy changes which occured in early March, essentially reflecting a flurry of economic policy activity during the initial wave of the COVID pandemic.
    • Most countries saw a drop-off in overall economic activity following the initial outbreak of COVID, while some countries, such as India saw a resurgence in economic policy changes during the months of August and September. This is likely due to those countries choosing to loosen COVID restrictions during these months.
    • Some countries enacted new policies relating to the transition to online and remote payment systems. Noteably, the US did not enact any specific policies regarding incentivizing online payment systems, likely because such systems were already widespread before the onset of COVID.

Choice of Visualization¶

This would be the most convinient method to visualize the graph because we can easily identify the number of the policy measures taken for all the countries in a particular year, and looking at the graph, the visual comparision would be very easy which inturn makes it very easy for the non - technical people to understand the graph better with out any efforts

In [44]:
# Multiple line graph to view the count of measures taken by a particular country in the year 2020

fig = plt.figure()
ax = fig.add_subplot(111)

ax.set_xlabel('Month')
ax.set_ylabel('No_of_Measures')
ax.set_title('Measures taken by UK in the year 2020')

ax.spines['bottom'].set_color('red')
ax.spines['top'].set_color('red')
ax.xaxis.label.set_color('red')
ax.tick_params(axis='x', colors='red')

plt.plot(covid_uk_pol_cat["Month"],covid_uk_pol_cat["Banking sector"], label = 'Banking sector')
plt.plot(covid_uk_pol_cat["Month"],covid_uk_pol_cat["Liquidity/funding"], label = 'Liquidity/funding')
plt.plot(covid_uk_pol_cat["Month"],covid_uk_pol_cat["Payment systems"], label = 'Payment systems')
plt.plot(covid_uk_pol_cat["Month"],covid_uk_pol_cat["Financial Markets/NBFI"], label = 'Financial Markets/NBFI')
plt.plot(covid_uk_pol_cat["Month"],covid_uk_pol_cat["Insolvency"], label = 'Insolvency')

plt.legend()

plt.show()

Interpretation¶

  • The following is the Multiple line graph to view the count of measures taken by a particular country in the year 2020.
  • The multiple lines on the graph shows the number of measures taken by UK per month.

Insights / Trends¶

From the following graph we can observe -

  • Banking Sector measures were taken the most among all categories of the country.
  • Liquidity/funding took a great fall in the country within first few months.
  • Measures related to Insolvency and Financial Market/NBFI were the lowest by any category of the country which is interesting.
  • Payment Systems were the second lowest by any category of the country which puts a question over the measures taken by the UK.
  • These interpretations can be determined easily with the help of multiple line graph.

Choice of Visualization¶

This would be the most convenient method to visualize the graph because we can easily identify the percentage of the count of measures taken by a particular country in the year 2020 looking at the graph and the visual comparison would be very easy which in turn makes it very easy for the non - technical people to understand the graph better without any efforts

Potential Sources of Error / Bias¶

  • With regards to the financial-policies data visualizations, there are two main possible sources of error. The first is an error in economic reporting from the countries who enacted these policies. Many countries might have made economic policies in secret, or in such a way that they were not widely reported and were not added to this data-set by the people compiling it. The second source of error is human error on the part of the group who compiled this data. It is possible that they miscategorized economic policies, or simply ran up against economic policies which did not cleanly fit into (just) a single category.

  • Finally, there is the fact that the economic policies listed included extensions of existing policy, implementations of new policy, and retractions of old policies. This means that the running policy count in these charts is for the total activity (in terms of number of policies altered) associated with economic policies of a particular category, not a running count of the total number of active economic policies.

Conclusion¶

The COVID-19 pandemic was an unprecedented exogenous shock that required immediate policy implementation targeted to the financial sector in order to stabilize the economy. Our analysis found that globally, the highest frequency of policy actions were during the first few months of COVID-19 in 2020, and tapered off a bit during the summer months. Specifically, the most common policy target areas overall were found to be the banking sector and liquidity/funding. The three remaining target areas, which comprise of payment systems, financial markets and nonbank financial institutions, and insolvency, saw significantly less policy action.

When broken down to the country level, we did not necessarily find the same trends as the overall global trend. Specifically, looking at the data for India’s policy measures, their largest target areas were the banking sector and financial markets/nonbank financial institutions. Interestingly, India also had the highest policy measure count of any country. On the other hand, the US more closely mimicked the global data as far as counts go, with the highest number of policy measures targeted to the banking sector and liquidity/funding. We also found that the key target areas differed by income level. Higher income countries tended to target the banking sector more frequently, whereas lower income countries frequently targeted liquidity/funding and payment systems.

These findings not only demonstrate the urgency of implementing financial policy measures to mitigate the COVID-19 pandemic, but that the needs of each country differ significantly depending on their existing economies and situations. While we are able to see a global trend, the trends of each individual economy vary as they each have different needs. While one policy measure may work for a particular country, it might not for another. This underscores the necessity of utilizing informed, data-driven analyses to guide financial policy implementation during an economic crisis.

In [ ]: